int temperature_populated; /* True if above is valid. */
unsigned char heartrate; /* Heartrate as in Garmin 301 */
unsigned char cadence; /* Crank cadence as in Edge 305 */
+ unsigned int wsensor_pres:1; /* Wheel sensor present */
unsigned int tnew:1; /* New track? */
unsigned int ishdr:1; /* Track header? */
unsigned int no_latlon:1; /* True if no valid lat/lon found. */
int32 dspl; /* Display on map? */
int32 colour; /* Colour */
float distance; /* distance traveled in meters.*/
+ int distance_populated; /* True if above is valid. */
char trk_ident[256]; /* Track identifier */
}
GPS_OTrack, *GPS_PTrack;
*trkpt = *(trk[j]);
trkpt->no_latlon = 1;
trkpt->alt = 1e25;
- trkpt->distance = 1e25;
+ trkpt->distance_populated = 0;
trkpt->heartrate = 0;
trkpt->cadence = 0xff;
trk = xrealloc(trk, (n+1) * sizeof(GPS_PTrack));
(*trk)->Time = GPS_Math_Gtime_To_Utime((time_t)t);
p+=sizeof(uint32);
- /* FIXME: check validity */
(*trk)->alt = GPS_Util_Get_Float(p);
p+=sizeof(float);
- /* FIXME: check validity */
(*trk)->dpth = GPS_Util_Get_Float(p);
p+=sizeof(float);
(*trk)->Time = GPS_Math_Gtime_To_Utime((time_t)t);
p+=sizeof(uint32);
- /* FIXME: check validity */
(*trk)->alt = GPS_Util_Get_Float(p);
p+=sizeof(float);
- /* FIXME: check validity */
(*trk)->dpth = GPS_Util_Get_Float(p);
p+=sizeof(float);
(*trk)->Time = GPS_Math_Gtime_To_Utime((time_t)t);
p+=sizeof(uint32);
- /* When latitude and longitude are undefined, this field seems to be
- * a constant on my receiver (51 59 04 69) */
- /* FIXME: check validity */
(*trk)->alt = GPS_Util_Get_Float(p);
- if (lat_undefined || lon_undefined) (*trk)->alt = 0.0f;
p+=sizeof(float);
/* Heartrate is reported as 0 if there is no signal from
switch (gps_trk_type) {
case pD304:
(*trk)->distance = GPS_Util_Get_Float(p);
+ (*trk)->distance_populated = ((*trk)->distance <= 1e24);
p+=sizeof(float); /* A float indicating number of meters travelled. */
(*trk)->heartrate = (*p++);
if (*p != 0xff) {
(*trk)->cadence = (*p);
}
-
- /* sensor present. Boolean */
p++;
-
+
+ (*trk)->wsensor_pres = (*p++);
+
break;
case pD303:
(*trk)->heartrate = *p++;
p+=sizeof(float);
if (protoid == 304) {
- GPS_Util_Put_Float(p, 1.0e25f); /* Distance, not supported for now */
+ GPS_Util_Put_Float(p, trk->distance_populated ? trk->distance : 1e25);
p+=sizeof(float);
}
*p = trk->cadence > 0 ? trk->cadence : 0xff;
p+=sizeof(char);
- *p = 0; /* Wheel sensor present, not supported for now */
+ *p = trk->wsensor_pres;
p+=sizeof(char);
}
if ((track->rte_name == NULL) ||
(case_ignore_str_match(track->rte_name, opt_name) == 0))
{
+ QUEUE_FOR_EACH((queue *)&track->waypoint_list, elem, tmp)
+ {
+ waypoint *wpt = (waypoint *)elem;
+ track_del_wpt((route_head *)track, wpt);
+ waypt_free(wpt);
+ }
track_del_head((route_head *)track);
return;
}
QUEUE_FOR_EACH((queue *)&curr->waypoint_list, elem, tmp)
{
waypoint *wpt = (waypoint *)elem;
- route_add_wpt(master, waypt_dupe(wpt));
+ track_del_wpt(curr, wpt);
+ track_add_wpt(master, wpt);
}
track_del_head(curr);
track_list[i].track = NULL;
while we do extract data such as heart rate and temperature from
tracks on the sporting models like Edge and Forerunner, GPSBabel
is not a fitness program at its core and does not support features
- like courses or calorie/fitness zone data.
+ like workouts or calorie/fitness zone data. Furthermore, sporting
+ models don't support track upload. When trying to upload tracks to
+ these devices, GPSBabel converts them to courses on the fly and
+ uploads these instead. When uploading waypoints at the same
+ time, these are converted to course points by mapping them to the
+ nearest track point on the track/course (no matter how far away from
+ the track they are). Since course point creation requires time
+ stamps for the track points, they are created automatically assuming
+ a speed of 10 km/h for tracks that lack them.
</para>
<para>